﻿@model Tippelde.Services.Dtos.EventWithBetData
<div id="bet-container-@Model.Id">
    @if (Model.HasBet)
    {
        <span>
            <span>Tippem:</span>
            <span>@Model.Bet.HomeBet</span>
            <span> - </span>
            <span>@Model.Bet.AwayBet</span>
        </span>
        if (!Model.HasResult && Model.IsBetInterval)
        {
            using (Html.BeginForm("Delete", "Bet", FormMethod.Post, new { @class = "form-container event-form form-bet form-ajax-confirm inline-submit-form" }))
            {
                @Html.ValidationSummary();
                @Html.AntiForgeryToken();
                @Html.HiddenFor(m => m.Id);

                if (!Model.HasResult)
                {
                <button type="submit" class="btn btn-xs btn-danger pull-right">
                    <span class="glyphicon glyphicon-remove"></span>
                    Törlöm
                </button>
                }
            }
        }
    }
    else
    {
        if (!Model.HasResult && Model.IsBetInterval)
        {
            using (Html.BeginForm("Bet", "Bet", FormMethod.Post, new { @class = "form-container event-form form-bet form-event-add" }))
            {
                @Html.ValidationSummary()
                @Html.AntiForgeryToken()
                @Html.HiddenFor(m => m.Id)
                <div class="input-group input-group-sm input-group-bet">


                    <span class="input-group-addon">Tippem:</span>
                    @Html.TextBoxFor(m => m.Bet.HomeBet, new { @class = "form-control", @type = "number" })
                    <span class="input-group-addon"> - </span>
                    @Html.TextBoxFor(m => m.Bet.AwayBet, new { @class = "form-control", @type = "number" })
                    <span class="input-group-btn">
                        <button type="submit" class="btn btn-success">
                            <span class="glyphicon glyphicon-ok"></span>
                        </button>
                    </span>
                </div>
            }
        }
    }
</div>
